import { Component, Vue } from "@some21/vue-class-decorator";
import { cloneDeep } from "lodash";

@Component
export default class FormDataMixins extends Vue {
  private ___FORMDATA_DEFAULT___ = null;

  get frmRules(): import("async-validator").Descriptor {
    return {};
  }
  frmData: typeof this.___FORMDATA_DEFAULT___ = {};

  /**
   * 初始化frmdata 的值
   */
  resetFrmData() {
    this.frmData = cloneDeep(this.___FORMDATA_DEFAULT___); // 深拷贝
  }

  created() {
    this.___FORMDATA_DEFAULT___ = cloneDeep(this.frmData);
  }
}
